package com.bite.spring.demo.service;

import com.bite.spring.demo.mapper.MessageMapper;
import com.bite.spring.demo.model.MessageInto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
//进行业务逻辑的实现；
public class MessageService {
//进行注入：数据底层类的实例对象；
    @Autowired
    private MessageMapper messageMapper;
    public void addMessage(MessageInto messageInto) {
        //进行向数据库中存放用户的相关留言；
        messageMapper.insertMessage(messageInto);
    }
//进行从数据库底层获取用户所有的留言信息；
    public List<MessageInto> queryAll() {
        return messageMapper.queryAll();
    }
}
